package com.yc.RSS.dao;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ProjectProperties extends Properties {
    private static ProjectProperties instance;
    private ProjectProperties(){
        //读取配置文件
        InputStream iis=ProjectProperties.class.getClassLoader().getResourceAsStream("project.properties");
        //Properties类的load方法加载

        try{
            this.load(iis); //this就是DbProperties 对象
        }catch (IOException e){
            throw new RuntimeException(e);
        }
    }

    public static ProjectProperties getInstance(){
        if(instance==null){
            instance=new ProjectProperties();
        }
        return instance;
    }
}
